﻿<%@ Page Language="C#"  MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SeaBattle.UI.Web.Models.RoomViewModel>" %>
<asp:Content ID="aboutTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Sea battle. Room
</asp:Content>

<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
  <div class="left-panel">
    <div class="account-panel">
    Your account: <span class="balance-amount"><%: Model.PlayerAccountBalance %></span>
    </div>
    <% if(Model.PlayerAccountBalance>=1) 
       {%>
        <div class="create-game-panel">
            <%: Html.ActionLink("Create new game", "Index", "GameSetting") %>
        </div><%
       } %>
    <div class="current-games-panel">
     <%
         Html.RenderAction("GameList", "Room", new { playerLogin = User.Identity.Name }); 
     %>
     </div>
     </div>
    <div class="game-list-panel">
    <% if (Model.GameList.Count() != 0)
       {%>
    <h2>Choose game</h2>
    <% } %>
    <% foreach (var game in Model.GameList){ %>
        <div class="game-list-element">
        <div class="star"></div>
      <p>Preset: <span class="preset"><%: game.Preset %></span></p>                                     
      <p>Player: <span> <%: Html.ActionLink(game.Creator.Name,"Index","Profile", new {login=game.Creator.Login}, new {}) %> </span></p>
      <p><%: Html.ActionLink("Join the game","Index","Game", new {id = game.Id }, new {}) %></p>
      </div>
    <%} %>
    </div>
</asp:Content>
